// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PROD_WO
// * CreateDate    : 2014-06-05 18:30:22
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:22
// * LastChanger   : 2014-06-05 18:30:22
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class ProdWoEntity : EntityBase
    {
        public ProdWoTable TableSchema
        {
            get
            {
                return ProdWoTable.Current;
            }
		}
		
		public ProdWoEntity()
        {

        }
		
		public ProdWoEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.PoId = Convert.ToString(CommonFunctions.ToObject(dr["PO_ID"]));
			this.BomItemId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_ITEM_ID"]));
			this.BomTechnicId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_TECHNIC_ID"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.ProductName = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_NAME"]));
			this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
			this.BlueprintId = Convert.ToString(CommonFunctions.ToObject(dr["BLUEPRINT_ID"]));
			this.WoNo = Convert.ToString(CommonFunctions.ToObject(dr["WO_NO"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.StorageQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["STORAGE_QTY"]));
			this.ScrapQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["SCRAP_QTY"]));
			this.Type = Convert.ToString(CommonFunctions.ToObject(dr["TYPE"]));
			this.ReqDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["REQ_DATE"]));
			this.ParentWoNo = Convert.ToString(CommonFunctions.ToObject(dr["PARENT_WO_NO"]));
			this.FinishDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["FINISH_DATE"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
			this.PlanStartDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PLAN_START_DATE"]));
			this.StartDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["START_DATE"]));
        }
		
		public ProdWoEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.PoId = Convert.ToString(CommonFunctions.ToObject(dr["PO_ID"]));
			this.BomItemId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_ITEM_ID"]));
			this.BomTechnicId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_TECHNIC_ID"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.ProductName = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_NAME"]));
			this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
			this.BlueprintId = Convert.ToString(CommonFunctions.ToObject(dr["BLUEPRINT_ID"]));
			this.WoNo = Convert.ToString(CommonFunctions.ToObject(dr["WO_NO"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.StorageQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["STORAGE_QTY"]));
			this.ScrapQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["SCRAP_QTY"]));
			this.Type = Convert.ToString(CommonFunctions.ToObject(dr["TYPE"]));
			this.ReqDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["REQ_DATE"]));
			this.ParentWoNo = Convert.ToString(CommonFunctions.ToObject(dr["PARENT_WO_NO"]));
			this.FinishDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["FINISH_DATE"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
			this.PlanStartDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PLAN_START_DATE"]));
			this.StartDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["START_DATE"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return ProdWoTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_ID)); }
            set { SetData(ProdWoTable.C_ID, value); }
        }
		
        [DataMember]
        public int IsActive
        {
            get { return Convert.ToInt32(GetData(ProdWoTable.C_IS_ACTIVE)); }
            set { SetData(ProdWoTable.C_IS_ACTIVE, value); }
        }
		
        [DataMember]
        public string CreatedBy
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_CREATED_BY)); }
            set { SetData(ProdWoTable.C_CREATED_BY, value); }
        }
		
        [DataMember]
        public DateTime CreatedDate
        {
            get { return Convert.ToDateTime(GetData(ProdWoTable.C_CREATED_DATE)); }
            set { SetData(ProdWoTable.C_CREATED_DATE, value); }
        }
		
        [DataMember]
        public string UpdatedBy
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_UPDATED_BY)); }
            set { SetData(ProdWoTable.C_UPDATED_BY, value); }
        }
		
        [DataMember]
        public DateTime UpdatedDate
        {
            get { return Convert.ToDateTime(GetData(ProdWoTable.C_UPDATED_DATE)); }
            set { SetData(ProdWoTable.C_UPDATED_DATE, value); }
        }
		
        [DataMember]
        public string PoId
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_PO_ID)); }
            set { SetData(ProdWoTable.C_PO_ID, value); }
        }
		
        [DataMember]
        public string BomItemId
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_BOM_ITEM_ID)); }
            set { SetData(ProdWoTable.C_BOM_ITEM_ID, value); }
        }
		
        [DataMember]
        public string BomTechnicId
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_BOM_TECHNIC_ID)); }
            set { SetData(ProdWoTable.C_BOM_TECHNIC_ID, value); }
        }
		
        [DataMember]
        public string ProductId
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_PRODUCT_ID)); }
            set { SetData(ProdWoTable.C_PRODUCT_ID, value); }
        }
		
        [DataMember]
        public string ProductName
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_PRODUCT_NAME)); }
            set { SetData(ProdWoTable.C_PRODUCT_NAME, value); }
        }
		
        [DataMember]
        public string ProductCode
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_PRODUCT_CODE)); }
            set { SetData(ProdWoTable.C_PRODUCT_CODE, value); }
        }
		
        [DataMember]
        public string BlueprintId
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_BLUEPRINT_ID)); }
            set { SetData(ProdWoTable.C_BLUEPRINT_ID, value); }
        }
		
        [DataMember]
        public string WoNo
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_WO_NO)); }
            set { SetData(ProdWoTable.C_WO_NO, value); }
        }
		
        [DataMember]
        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(ProdWoTable.C_QTY)); }
            set { SetData(ProdWoTable.C_QTY, value); }
        }
		
        [DataMember]
        public string Unit
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_UNIT)); }
            set { SetData(ProdWoTable.C_UNIT, value); }
        }
		
        [DataMember]
        public decimal StorageQty
        {
            get { return Convert.ToDecimal(GetData(ProdWoTable.C_STORAGE_QTY)); }
            set { SetData(ProdWoTable.C_STORAGE_QTY, value); }
        }
		
        [DataMember]
        public decimal ScrapQty
        {
            get { return Convert.ToDecimal(GetData(ProdWoTable.C_SCRAP_QTY)); }
            set { SetData(ProdWoTable.C_SCRAP_QTY, value); }
        }
		
        [DataMember]
        public string Type
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_TYPE)); }
            set { SetData(ProdWoTable.C_TYPE, value); }
        }
		
        [DataMember]
        public DateTime ReqDate
        {
            get { return Convert.ToDateTime(GetData(ProdWoTable.C_REQ_DATE)); }
            set { SetData(ProdWoTable.C_REQ_DATE, value); }
        }
		
        [DataMember]
        public string ParentWoNo
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_PARENT_WO_NO)); }
            set { SetData(ProdWoTable.C_PARENT_WO_NO, value); }
        }
		
        [DataMember]
        public DateTime FinishDate
        {
            get { return Convert.ToDateTime(GetData(ProdWoTable.C_FINISH_DATE)); }
            set { SetData(ProdWoTable.C_FINISH_DATE, value); }
        }
		
        [DataMember]
        public string Status
        {
            get { return Convert.ToString(GetData(ProdWoTable.C_STATUS)); }
            set { SetData(ProdWoTable.C_STATUS, value); }
        }
		
        [DataMember]
        public DateTime PlanStartDate
        {
            get { return Convert.ToDateTime(GetData(ProdWoTable.C_PLAN_START_DATE)); }
            set { SetData(ProdWoTable.C_PLAN_START_DATE, value); }
        }
		
        [DataMember]
        public DateTime StartDate
        {
            get { return Convert.ToDateTime(GetData(ProdWoTable.C_START_DATE)); }
            set { SetData(ProdWoTable.C_START_DATE, value); }
        }
		
		#endregion
	}
	
	
}	

